import request from '@/utils/request'

/**
 * 获取点检计划列表详情
 * @param List
 */
export function list(query, pagination) {
  return request({

    url: `/mes/m/repair/check/list`,
    method: 'post',
    data: query,
    params: pagination
  })
}
/**
 * 查询/修改点检计划单条数据
 * @param update
 */
export function detail(id) {
  return request({

    url: `/mes/m/repair/check/getById/${id}`,
    method: 'get'
  })
}
/**
 * 点检计划新增或修改
 * @param update
 */
export function save(data) {
  return request({
    url: `/mes/m/repair/check/save`,
    method: 'put',
    data
  })
}

/**
 * 点检计划删除
 * @param update
 */
export function removeCheck(data) {
  return request({
    url: `/mes/m/repair/check/delete`,
    method: 'delete',
    data: data
  })
}

/**
 * 数据收集组
 * @param update
 */
export function collectionList(data) {
  return request({
    url: `/mes/m/data/collection/list`,
    method: 'post',
    data: data
  })
}

// 根据计划id 获取录入信息
export function getInputInfo() {
  return request({
    // BaseURL:'',
    // url: `http://localhost:19003/m/repair/check/inputInfo`,
    url: `/mes/m/repair/check/inputInfo`,
    method: 'get'
  })
}
// 根据设备类型获取点检项
export function querySpotCheckByDeviceType(deviceType) {
  return request({
    url: `/mes/m/repair/check/queryByDeviceType?deviceType=${deviceType}`,
    method: 'get'
  })
}

// 保存点检单信息
export function saveCheckPlan(data) {
  return request({
    // BaseURL:'',
    // url: `http://localhost:19003/m/repair/check/saveCheckOrder`,
    url: `/mes/m/repair/check/saveCheckOrder`,
    method: 'post',
    data
  })
}
